package com.example.droideep.common.dummydata;

import android.support.v4.app.Fragment;

import com.example.droideep.fragment.CalendarCardPagerFragment;
import com.example.droideep.fragment.CalendarPickerViewFragment;
import com.example.droideep.fragment.CollapseCalendarViewFragment;
import com.example.droideep.fragment.ExtendedCalendarViewFragment;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Helper class for providing sample content for user interfaces created by
 * Android template wizards.
 * <p/>
 * TODO: Replace all uses of this class before publishing your app.
 */
public class CalendarHolder {

    /**
     * An array of sample (dummy) items.
     */
    public static List<CalendarItem> ITEMS = new ArrayList<CalendarItem>();

    /**
     * A map of sample (dummy) items, by ID.
     */
    public static Map<String, CalendarItem> ITEM_MAP = new HashMap<String, CalendarItem>();

    static {
        // Add 3 sample items.
        addItem(new CalendarItem("1", "CollapseCalendarView", new CollapseCalendarViewFragment()));
        addItem(new CalendarItem("2", "CalendarPickerView", new CalendarPickerViewFragment()));
        addItem(new CalendarItem("3", "CalendarCardPager", new CalendarCardPagerFragment()));
        addItem(new CalendarItem("4", "ExtendedCalendarView", new ExtendedCalendarViewFragment()));
    }

    private static void addItem(CalendarItem item) {
        ITEMS.add(item);
        ITEM_MAP.put(item.id, item);
    }

    /**
     * A dummy item representing a piece of content.
     */
    public static class CalendarItem {
        public String id;
        public String content;
        public Fragment container;

        public CalendarItem(String id, String content, Fragment fragment) {
            this.id = id;
            this.content = content;
            this.container = fragment;
        }

        @Override
        public String toString() {
            return content;
        }
    }
}
